package cn.wen.yinxiu.member.listen;import cn.wen.yinxiu.member.server.socket.NettyServer;import org.springframework.beans.factory.DisposableBean;import org.springframework.context.ApplicationListener;import org.springframework.context.event.ContextRefreshedEvent;import org.springframework.stereotype.Component;import javax.annotation.Resource;/** * @ClassName: NettyStartListener * @Author: 小飞 * @Date: 2023/6/3 17:19 * @Description: */@Componentpublic class NettyStartListener implements ApplicationListener<ContextRefreshedEvent> {    @Override    public void onApplicationEvent(ContextRefreshedEvent event) {//        //判断event上下文中的父级是否为空//        if (event.getApplicationContext().getParent() == null) {//            try {//                // 为空则调用start方法//                nettyServer.start();//            } catch (Exception e) {//                e.printStackTrace();//            }//        }    }}